import 'package:rfid/generated/json/base/json_convert_content.dart';
import 'package:rfid/entity/lock_state_entity.dart';

LockStateEntity $LockStateEntityFromJson(Map<String, dynamic> json) {
	final LockStateEntity lockStateEntity = LockStateEntity();
	final String? addr = jsonConvert.convert<String>(json['addr']);
	if (addr != null) {
		lockStateEntity.addr = addr;
	}
	final String? count = jsonConvert.convert<String>(json['count']);
	if (count != null) {
		lockStateEntity.count = count;
	}
	final List<LockStateList>? list = jsonConvert.convertListNotNull<LockStateList>(json['list']);
	if (list != null) {
		lockStateEntity.list = list;
	}
	return lockStateEntity;
}

Map<String, dynamic> $LockStateEntityToJson(LockStateEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['addr'] = entity.addr;
	data['count'] = entity.count;
	data['list'] =  entity.list?.map((v) => v.toJson()).toList();
	return data;
}

LockStateList $LockStateListFromJson(Map<String, dynamic> json) {
	final LockStateList lockStateList = LockStateList();
	final int? addr = jsonConvert.convert<int>(json['addr']);
	if (addr != null) {
		lockStateList.addr = addr;
	}
	final int? no = jsonConvert.convert<int>(json['no']);
	if (no != null) {
		lockStateList.no = no;
	}
	final int? state = jsonConvert.convert<int>(json['state']);
	if (state != null) {
		lockStateList.state = state;
	}
	return lockStateList;
}

Map<String, dynamic> $LockStateListToJson(LockStateList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['addr'] = entity.addr;
	data['no'] = entity.no;
	data['state'] = entity.state;
	return data;
}